package com.gzdh.tang.config.ali;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class AliConfig {
    @Value("${ali.pay.protocol}")
    private String protocol;

    @Value("${ali.pay.appid}")
    private String appid;

    @Value("${ali.pay.gateway}")
    private String gateway;

    @Value("${ali.pay.signType}")
    private String signType;

    @Value("${ali.pay.notifyUrl}")
    private String notifyUrl;

    @Value("${ali.pay.privateKey}")
    private String privateKey;

    @Value("${ali.pay.publicKey}")
    private String publicKey;

    @Value("${ali.pay.appAuthToken}")
    private String appAuthToken;

    @Value("${ali.pay.assignJointAccountId}")
    private String assignJointAccountId;

    @Value("${ali.pay.pid}")
    private String pid;


    @Value("${ali.qrAuth.privateKey}")
    private String qrAuthPrivateKey;

    @Value("${ali.qrAuth.publicKey}")
    private String qrAuthPublicKey;

    @Value("${ali.qrAuth.appid}")
    private String qrAuthAppid;

    @Value("${ali.qrAuth.pid}")
    private String qrAuthPid;




    @Bean
    public void aliInit() {
        AliPayUtil.setProtocol(protocol);
        AliPayUtil.setAppid(appid);
        AliPayUtil.setGateway(gateway);
        AliPayUtil.setSignType(signType);
        AliPayUtil.setNotifyUrl(notifyUrl);
        AliPayUtil.setPrivateKey(privateKey);
        AliPayUtil.setPublicKey(publicKey);
        AliPayUtil.setAppAuthToken(appAuthToken);
        AliPayUtil.setAssignJointAccountId(assignJointAccountId);
        AliPayUtil.setPid(pid);
        AliPayUtil.setQrAuthPrivateKey(qrAuthPrivateKey);
        AliPayUtil.setQrAuthPublicKey(qrAuthPublicKey);
        AliPayUtil.setQrAuthAppid(qrAuthAppid);
        AliPayUtil.setQrAuthPid(qrAuthPid);


    }

}
